<?php
// Module Definition
$module['name'] = 'Unix Users';
$module['description'] = 'Create virtual users in /etc/passwd';

switch($action) {
	case 'register':
		break;
	case 'unregister':
		break;
	case 'enable':
		break;
	case 'disable':
		break;
	case 'hook':
		register_hook('web:personal:userinfo:table', 'unix_users_info');
		register_hook('user:get:username', 'unix_username');
		
		global $cfg;
		switch ($cfg['os']) {
			case 'linux':
				register_hook('server:user:create', 'unix_users_create_linux');
				register_hook('server:user:remove', 'unix_users_remove_linux');
				register_hook('server:user:update', 'unix_users_update_linux');
				register_hook('server:user:suspend', 'unix_users_suspend_linux');
				register_hook('server:user:unsuspend', 'unix_users_unsuspend_linux');
				break;
			case 'freebsd':
				register_hook('server:user:create', 'unix_users_create_bsd');
				register_hook('server:user:remove', 'unix_users_remove_bsd');
				register_hook('server:user:update', 'unix_users_update_bsd');
				register_hook('server:user:suspend', 'unix_users_suspend_bsd');
				register_hook('server:user:unsuspend', 'unix_users_unsuspend_bsd');
				break;
		}
		break;
}
?>